package com.aube.model;

import com.huyn.baseframework.model.BaseModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by huyaonan on 16/4/8.
 */
public class VideoModel extends BaseModel {

    public List<String> videoPath;

    public void init() {
        videoPath = new ArrayList<>();
    }

    public void add(String str) {
        videoPath.add(str);
    }

    public int size() {
        if(videoPath == null)
            return 0;
        return videoPath.size();
    }

    public String getOneUrl() {
        if(size() > 0)
            return videoPath.get(0);
        return null;
    }

    public String getOneUrl(int quanlity) {
        if(size() > 0) {
            for(String s : videoPath)
                if(s.contains("-" + quanlity + "."))
                    return s;
            return videoPath.get(0);
        }
        return null;
    }

}
